<style>
.headinfo {
    background: none;
}
.headinfo .mod-member {
    margin: 0 auto;
	margin-top: -60px;
    width: 94%;
	left:3%;
    padding: 6px 0 10px;
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #f2f2f2;
}
.headinfo .mod-member .sign-btn{
    position: absolute;
    margin: 0 auto;
	top: -44px;
    width: 36px;
	height: 26px;
	right:16px;
    color:#fff;
	text-align:center;
	padding-top:3px;
    background: #7c1cc9;
}
.bottombg {bottom:-20px;width:100%;height:80px;border-bottom-right-radius:100% 40px;border-bottom-left-radius:100% 40px;}
.mod-group {
    margin: 0 auto;
	margin-top: 5px;
    width: 94%;
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #f2f2f2;
}
.fui-icon-group .fui-icon-col-sm {
    margin:10px 0;
}
.badge {
    left: 2rem;
    top: 0;
}
</style>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='main'">
    <div class="fui-header">
		<div class="fui-header-left" onclick="window.history.go(-1);">
            <a class="back"></a>
        </div>
		<div class="title">会员中心</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content member-page' style="top:0">
		<div class="bottombg" style="background:{{main.syscolor || '#7c1cc9'}};"></div>
		<div class="headinfo" style="height:auto;">		
				<div class="mod-member">
						<div class="headinfo" style="background:none;padding:0;color:#999">
												<div class="child userinfo" style="padding-bottom:5px;color:#999;width:4rem">
													<div class="face" style="margin-right:0.6rem;padding: 0.1rem;" href="javascript:;" ng-click="access_json('core/member.cavatar/')">
															<img ng-src="{{tomedia(pagedata.member.avatar) || '../core/resource/images/gw-user.png'}}" />
															<span class="vip" style="top: 2.3rem;background: {{main.syscolor || '#4491F1'}} none repeat scroll 0 0;"><i class="icon icon-vip5" style="font-size:0.5rem;padding-left:0.1rem"></i></span>
													</div>
												</div>
												<div class="child userinfo" style="padding-bottom:0;color:#999;flex: 1;text-align:left;">
													<div class="l bold" style="width:100%">{{pagedata.member.nickname}}</div>
													<div class="l" style="font-size:0.6rem">
														<div style="width:100%;font-size:0.6rem" href="javascript:;" ng-click="access_json('core/member.set/')">手机: {{pagedata.member.mobile}} <span style="color:{{main.syscolor || '#4491F1'}}">设置</span></div>
														<div class="btn btn-sm btn-default-o" href="javascript:;" ng-click="access_json('jy_chatgpt/recharge/')" style="color:{{main.syscolor || '#4491F1'}};border: 1px solid {{main.syscolor || '#4491F1'}};margin-top:0;padding:0 0.5rem;background:none;width:auto">充值金币</div>
														<div class="" ng-if="pagedata.basic.no_vip !=1 && pagedata.user.isvip==1 && pagedata.user.vipstatus ==1" href="javascript:;" ng-click="access_json('jy_chatgpt/home/buyvip/')">
															VIP到期时间:{{pagedata.user.viptime}} 
															<span class="btn btn-success"> 续费VIP</span>
														</div>
														<div class="" ng-if="pagedata.basic.no_vip !=1 && pagedata.user.isvip==1 && pagedata.user.vipstatus ==2" href="javascript:;" ng-click="access_json('jy_chatgpt/home/buyvip/')">
															VIP已过期 <span class="btn btn-success">续费VIP</span>
														</div>
														<div class="" ng-if="pagedata.basic.no_vip !=1 && pagedata.user.isvip!=1" href="javascript:;" ng-click="access_json('jy_chatgpt/home/buyvip/')">
															<span class="btn btn-success" style="">购买VIP</span>
														</div>
													</div>
												</div>
									
						</div>
						<div class="fui-icon-group noborder  col-4">
												<div class="fui-icon-col-sm external" style="margin:0">
													<div href="javascript:;" ng-click="access_json('core/member.recharge/')">
														<div class="text bold">{{pagedata.member.credit2 || '0.00'}}</div>
														<div class="subtitle" style="font-size:12px;color: #666;">余额 <span style="color:{{main.syscolor || '#4491F1'}}">充值</span></div>
													</div>
												</div>
												<div class="fui-icon-col-sm external" style="margin:0">
													<div>
														<div class="text bold">{{pagedata.member.credit1 || '0'}}</div>
														<div class="subtitle" style="font-size:12px;color: #666;">我的积分</div>
													</div>
												</div>
												<div class="fui-icon-col-sm external" style="margin:0">
													<div>
														<div class="text bold">{{pagedata.member.mycoupon || 0}}</div>
														<div class="subtitle" style="font-size:12px;color: #666;">优惠券</div>
													</div>
												</div>
												<div class="fui-icon-col-sm external" style="margin:0">
													<div>
														<div class="text bold">{{pagedata.member.ideal_money || '0.00'}}</div>
														<div class="subtitle" style="font-size:12px;color: #666;">现金红包</div>
													</div>
												</div>
						</div>
					</div>
				</div>
		<div style="padding:0.5rem">
		<div class="fui-cell-group fui-cell-click " style="margin-top:0">
				<a class="fui-cell external" href="javascript:;" ng-click="access_json('core/member.xunibi//type=3')">
					<div class="fui-cell-text bold">我的金币 （{{pagedata.member.credit3 || '0.00'}}）</div>
					<div class="fui-cell-remark" style="font-size: 0.65rem;">查看金币日志</div>
				</a>
				<a class="fui-cell"  href="javascript:;" ng-click="access_json('jy_chatgpt/mychat/')">
					<div class="fui-cell-icon"><i class="icon icon-liaotian"></i></div>
					<div class="fui-cell-text"><p>我的对话</p></div>
					<div class="fui-cell-remark"></div>
				</a>
				<a class="fui-cell"  href="javascript:;" ng-click="access_json('jy_chatgpt/home/viplog/')">
					<div class="fui-cell-icon"><i class="icon icon-jiangjiatongzhi"></i></div>
					<div class="fui-cell-text"><p>VIP购买记录</p></div>
					<div class="fui-cell-remark"></div>
				</a>
		</div>
		<div class="fui-cell-group fui-cell-click" style="background:none">
					<a class="fui-cell external changepwd" href="javascript:;" ng-click="access_json('jy_chatgpt/index/')">
						<div class="fui-cell-text" style="text-align: center;">去聊聊天 <i class="icon icon-zhifeiji"></i></div>
					</a>
		</div>
		</div>
		<div ng-include="sys_html('common/_copyright',true)"></div>
	</div>
</div>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='buyvip'">
<div class="fui-content">
		<div class="fui-picture">
				<a style="display: block; padding: {paddingtop}px {paddingleft}px;" data-nocache="true">
					<img ng-src="{{tomedia(pagedata.vipbg) || '../core/resource/images/nopic.jpg'}}">
				</a>
		</div>
		<div class="fui-cell-group fui-cell-click" style="padding-bottom:0.3rem">
			<div class="fui-cell sm">
				<div class="fui-cell-label" style='width:auto' >付费方式</div>
				<div class="fui-cell-text"> <span ng-click="pagedata.type(1);" ng-class="{'jylabel jylabel-red':1,'active':pagedata.post.paytype==1}" style="margin-right:10px">按月支付</span><span ng-click="pagedata.type(2);" ng-class="{'jylabel jylabel-red':1,'active':pagedata.post.paytype==2}" style="margin-right:10px">按季支付</span><span ng-click="pagedata.type(3);" ng-class="{'jylabel jylabel-red':1,'active':pagedata.post.paytype==3}">按年支付</span></div>
			</div>
			<div class="fui-cell sm">
				<div class="fui-cell-label" style='width:auto' >开通时长</div>
				<div class="fui-cell-mask noremark" style="margin-right:10px">
					 <div class="fui-number">
						<div class="minus" ng-click="pagedata.minus(pagedata.post.paytype)">-</div>
						<input class="num" type="tel" name="" value="{{pagedata.post.num}}" readonly="readonly"/>
						<div class="plus" ng-click="pagedata.plus(pagedata.post.paytype)">+</div>
					</div>
				</div>
				<div ng-if="pagedata.post.paytype==1" class="fui-cell-text">个月</div><div ng-if="pagedata.post.paytype==2"  class="fui-cell-text" >个季度</div><div ng-if="pagedata.post.paytype==3" class="fui-cell-text">年</div>
			</div>
			<div class="fui-cell sm">
				<div class="fui-cell-label" style='width:auto' >费用合计：</div>
				<div class="fui-cell-text bold" style="color:red"> ￥{{pagedata.fee || '0.00'}} <span class="delete">原价:￥{{pagedata.fee0}}</span></div>
			</div>
			</div>
		<div class="weui_cells_checkbox" style="margin-top:2rem">
                <div class="fui-cell-label" style="text-align:center;margin:0 auto;padding:0.2rem">
                    <input type="checkbox" class="fui fui-checkbox fui-checkbox-danger verify-checkbox" style="line-height:0.6rem" ng-checked="pagedata.post.checked==true" ng-model="pagedata.post.checked">
					我已阅读并同意《<a onclick="$('#showsystemcontent').modal();" style="color:f60">会员协议</a>》
                </div>
        </div>
		<div class="weui_btn_area" style="margin-top:0">
			 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="pagedata.buyvip();">提交</a>
		</div>
</div>
<div id="showsystemcontent" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:96%;left:2%;top:1.5%;">
<div class="modal-content" style="min-height:500px">
	<div aria-hidden="true" data-dismiss="modal" class="closebtn" style="right:10px;top:0"><i class="icon jinyunicon icon-wrong" style="color:#ccc;"></i></div>
	<div class="fui-article-page">
			<div class="fui-article-title" style="text-align:center">平台声明</div>
			<div class="fui-article-content" ng-bind-html="trust(pagedata.basic.systemcontent)"></div>
	</div>
</div>
</div>
</div>
<script type="text/javascript">
//购买
scope.pagedata.buyvip=function(){
	if(!scope.pagedata.post.checked){
		scope.message('请先阅读并勾选《会员协议》','error');
		return false;
	}
	var params={
		data:{'num':scope.pagedata.post.num,'paytype':scope.pagedata.post.paytype},
		op:'buyvip',
		callback:function(res){
			if(res.payid){
				require(['tool'],function(tool){
					tool.pay(res.payid,function(res){
						if(res.type=='success'){
							scope.message('支付成功！','','/home/');
							
						}else{
							scope.message('支付失败！失败原因：'+res.message,'error');
						}
					});
				});
			}
		}
	};
	scope.post_json(params);
	return
}
//减少
scope.pagedata.minus=function(type){
	if(scope.pagedata.post.num <=1){
		return false;
	}
	scope.pagedata.post.num--;
	scope.pagedata.jisuan(type,scope.pagedata.post.num);
	return
}
//增加
scope.pagedata.plus=function(type){
	scope.pagedata.post.num++;
	scope.pagedata.jisuan(type,scope.pagedata.post.num);
	return
}
//选择付款类型
scope.pagedata.type=function(type){
	scope.pagedata.post.num=1
	scope.pagedata.post.paytype = type;
	scope.pagedata.jisuan(type,scope.pagedata.post.num);
	return
}
//计算
scope.pagedata.jisuan=function(type,num){
	if(type ==1){
		scope.pagedata.fee = getprice(scope.pagedata.basic.mfee * num)
		if(scope.pagedata.basic.mfee0){
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.mfee0 * num)
		}else{
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.mfee * 1.5 * num)
		}
	}else if(type ==2){
		scope.pagedata.fee = getprice(scope.pagedata.basic.jfee * num)
		if(scope.pagedata.basic.jfee0){
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.jfee0 * num)
		}else{
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.jfee * 1.5 * num)
		}
		
	}else if(type ==3){
		scope.pagedata.fee = getprice(scope.pagedata.basic.yfee * num)
		if(scope.pagedata.basic.yfee0){
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.yfee0 * num)
		}else{
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.yfee * 1.5 * num)
		}
	}
	scope.$evalAsync();
}
function getprice(num)
{
	//var num = parseFloat(num);
	num = num.toFixed(2);
	//console.log(num);
	return num
	
}
</script>
</div>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='viplog'">
<div class="fui-content" style="margin-bottom:4.8rem">
	<div class="jy-content">
		<div class="fui-cell-group fui-comment-group" ng-repeat="item in pagedata.list">	
				<div class="fui-cell">
					<div class="fui-cell-text">
						<div class="text bold" style="font-size:0.65rem;color:#5c5c5c">{{item.fee}}元</div>
						<div class="gray" style="font-size:0.55rem">{{item.createtime}}</div>
					</div>
					<div class="fui-cell-remark noremark">
						<span class="red">{{item.ispay}}</span>
					</div>
				</div>
				<div ng-if="!pagedata.loading && (!pagedata.list || pagedata.list.length<1)" class='content-empty' style="margin-top:0">
					<i class='icon icon-cry' style="font-size:1.5rem"></i><br/>暂时没有任何信息
				</div>
		</div>
		<div ng-show="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
		<div ng-include="sys_html('common/_copyright',true)"></div>
	</div>
</div>
<script>
	scope.tool.get_list('jy_chatgpt/home/viplog/',true);
	scope.pagedata.scroll_bottom=function(){
		scope.tool.get_list('jy_chatgpt/home/viplog/');
	}
</script>
</div>
<div ng-if="pagedata.showrecharge" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="background:#fc6d60">
			<style>
				input{ caret-color: #fff;}
				.fui-cell-group .fui-cell .fui-cell-info  ::-webkit-input-placeholder{
					color: #fff
				}
				.fui-cell-group .fui-cell .fui-cell-info {
					font-size: 0.85rem;
					color: #fff;
				}
			</style>
			<i class="closed icon icon-cuowu" ng-click="pagedata.showrecharge=false"></i>
			 <div class='fui-cell-group fui-cell-group-o' style="margin:0.5rem 1rem;padding-top:0.5rem;background:#fc6d60">
				<div class='fui-cell-title c' style="color:#fff">您正在进行【{{pagedata.typetitle || '金币'}}】充值操作
				</div>
				<div class='fui-cell'>
					<div class='fui-cell-label big' style='width:auto;color:#fff'><i class="icon icon-dixiaofei" style="font-size:0.8rem"></i></div>
					<div class='fui-cell-info'>
					<input type='text' class='fui-input' placeholder="充值额度" ng-change="pagedata.upfee()" ng-model="pagedata.post.jifen">
					</div>
				</div>
			</div>
			<div class="weui_btn_area" style="margin:2rem;">
				<div class="c" style="font-size:0.6rem;margin-top:-0.3rem;color:#fff">
						需支付：￥{{pagedata.post.fee || 0}} （充值比例：{{pagedata.bi_rate}}比1）						
				</div>
				<a class='weui_btn weui_btn_primary' style="border-radius:1rem;background-color:#fff;color:#fc6d60" ng-click="pagedata.recharge()">确认充值</a>
			</div>
		</div>
	</div>
	<script>
	scope.pagedata.upfee=function(){
		scope.pagedata.post.fee=(scope.pagedata.post.jifen/scope.pagedata.bi_rate).toFixed(2);
	}
	scope.pagedata.recharge=function(){
		scope.pagedata.post.type=3
		scope.post_json('jy_chatgpt/home/recharge/',scope.pagedata.post,function(pay_id){
			var success_url='/home//type='+scope.pagedata.post.type;
			scope.tool.pay(pay_id,function(res){
					if(res.type=='success'){
						scope.message('支付成功！','success',success_url);
					}else{
						scope.message('支付失败！','success',success_url);
					}
			},'','',success_url,success_url);
		});
	}
	</script>
</div>
<div ng-include="sys_html('_footer')"></div>